package com.jerry.provider.service.impl;

import com.jerry.common.bean.Ad;
import com.jerry.provider.dao.AdDao;
import com.jerry.provider.service.AdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdServiceImpl implements AdService {
	
	@Autowired
	private AdDao adDao;

	@Override
	public List<Ad> list() {
		return adDao.findAll();
	}
	
	@Override
	public Ad get(Long id) {
		return adDao.findById(id);
	}
	
	@Override
	public boolean add(Ad ad) {
		return adDao.add(ad);
	}

	@Override
	public boolean update(Ad ad) {
		return adDao.update(ad);
	}
	
	@Override
	public void delete(Long id) {
        adDao.deleteById(id);
	}
	
}
